#!/bin/bash
echo 'Importing Day' ${1}

CLASSPATH="/Users/scanfield/Documents/School/Summer07Project/upsferry/mysql-connector-java-5.0.5/mysql-connector-java-5.0.5-bin.jar:/Users/scanfield/Documents/School/Summer07Project/upsferry:/Users/scanfield/Documents/School/Summer07Project/upsferry/htmlparser1_6/lib/htmlparser.jar"

cd /Users/scanfield/Documents/School/Summer07Project/upsferry/Ferry_11_2006/Seattle

if [ $1 -lt 10 ]; then
	PATTERN=2006\.00${1}*.gif
else 
	if [ $1 -lt 100 ]; then
	PATTERN=2006\.0${1}*.gif
	fi
fi

if [ $1 -gt 99 ]; then
	PATTERN=2006\.${1}*.gif
fi

FILELIST=/Users/scanfield/Documents/School/Summer07Project/upsferry/Test/FileList.txt

rm /Users/scanfield/Documents/School/Summer07Project/upsferry/Test/FileList.txt


FILE=Ferry_11_2006/Seattle/${PATTERN}
echo "File = " ${FILE}
echo ${FILE} >> /Users/scanfield/Documents/School/Summer07Project/upsferry/Test/FileList.txt

cd /Users/scanfield/Documents/School/Summer07Project/upsferry/

java -cp $CLASSPATH ups/MapParse/MapParse --fileList $FILELIST --save NO